<template>
  <div class="content">
    <div class="zhanswei"></div>
    <div class="header_top" data-margin="0" v-if="isok==true">
      <div class="hede">
        <div class="header_top_search">
          <div class="search">
            <div class="search_bg">
              <img src="../assets/images/img/search.png" alt class="img_ss" />
            </div>
            <input type="text" class="search_inpt" :class="{'search_inpt_bg':search_inpt_bg_is}" @input="changeInput"
              v-model="search_ss" placeholder="请输入地址/名称/姓名/类别/单位" @focus="focusinpt()" />
            <img src="../assets/images/mhcx_clear.png" class="img_xx" v-show="search_inpt_bg_is" @click="search_xx" />
          </div>
          <img src="../assets/images/img/xj.png" alt class="img_xj" v-show="!search_inpt_bg_is" @click="scan" />
          <div class="btn_ss" v-show="search_inpt_bg_is" @click="onRefresh">搜索</div>
        </div>
        <div class="boxs" :class="{'boxs_active':lie_cont==5}">
          <div class="box">
            <div v-for="(item, index) in listArry" style="position: relative;" :key="index"
              @click="showed(index,item.id)" v-if="index<is_noe" :class="{'grayscale':item.onclick==false}"
              v-show="item.isShow==true">
              <div class="redx" v-show="red_is"></div>
              <div class="redx" v-show="index==2&&red_is_rwjb"></div>
              <img class="hours" :src="item.imgurl" />
              <div class="words">{{ item.txt }}</div>
            </div>
          </div>
          <div class="box">
            <div v-for="(item, index) in listArry" style="position: relative;" :key="index"
              @click="showed(index,item.id)" v-if="index>is_noe-1" :class="{'grayscale':item.onclick==false}"
              v-show="item.isShow==true">
              <div class="redx" v-show="red_is"></div>
              <div class="redx" v-show="index==2&&red_is_rwjb"></div>
              <img class="hours" :src="item.imgurl" />
              <div class="words">{{ item.txt }}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="main-index">
      <div class="hr"></div>
      <!-- <van-pull-refresh v-model="refreshing" @refresh="onRefresh"> -->
      <van-list v-model="loading" :finished="finished" @load="onLoad">
        <div v-for="(item, index) in list" :key="index" @click="btn(item)" v-if="list.length !=0" :data-name="item.type"
          :data-lev="item.lev" :data-index="index" :data-jie="item.patrolTroubleshoot">
          <div class="main_item" data-name="巡查排查"
            v-if="(item.type=='巡查排查' || item.type=='消防安全' || item.type=='生产安全' || item.type=='房屋建筑' || item.type=='自然灾害' || item.type=='其他安全') && item.imgurl !=''">
            <div class="item_left">
              <div class="item_left_top">
                <div class="item_left_top_item" v-if="item.lev==0 || item.lev==-1">
                  <img src="../assets/images/logo5.png" alt class="img_list" />
                  <span v-if="item.patrolTroubleshoot==0 || item.patrolTroubleshoot==null || item.patrolTroubleshoot==''">
                    <!-- 科室 -->
                    <span v-if="item.permission==3" :data-permission="item.permission">
                      {{titleTime(item.tIME)}}日{{item.rnm}}巡查{{item.zgfXqmc}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span>
                    </span>
                    <!-- 社区 -->
                    <span v-else-if="item.permission ==2" :data-permission="item.permission">
                      {{titleTime(item.tIME)}}日{{item.jc}}巡查{{item.zgfXqmc}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span>
                    </span>
                    <!-- 街道 -->
                    <span v-else-if="item.permission ==1" :data-permission="item.permission">
                      {{titleTime(item.tIME)}}日{{item.jc}}巡查{{item.zgfXqmc}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span>
                    </span>
                    <!-- 部门 -->
                    <span v-else-if="item.permission ==6" :data-permission="item.permission">
                      {{titleTime(item.tIME)}}日{{item.jc}}巡查{{item.zgfXqmc}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span>
                    </span>
                    <!-- 最高 -->
                    <span v-else-if="item.permission ==0" :data-permission="item.permission">
                      {{titleTime(item.tIME)}}日{{item.jc}}巡查{{item.zgfXqmc}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span>
                    </span>
                    <!--  4 5 企业    6部门 -->
                    <span v-else :data-permission="item.permission">
                      {{titleTime(item.tIME)}}日{{item.unitsName}}巡查{{item.zgfXqmc}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span>
                    </span>

                  </span>
                  <span v-else>
                    {{titleTime(item.tIME)}}日{{item.rnm != ''? item.rnm :item.jc}}巡查{{item.unitsName}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span>
                  </span>
                </div>
                <div class="item_left_top_item" v-else-if="item.lev==1">
                  <img src="../assets/images/logo5.png" alt class="img_list" />
                  <span v-if="item.permission==2">{{titleTime(item.tIME)}}日{{item.leftJc}}{{item.dwName}}{{item.zhiwu=="0"?"":item.zhiwu}}{{item.endName}}巡查{{item.rnm==''?item.jc:item.rnm}}<span>{{item.unitsName}}</span>{{item.zgfXqmc==null?'':item.zgfXqmc}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span></span>
                   <span v-else-if="item.permission==1">{{titleTime(item.tIME)}}日{{item.leftJc}}{{item.dwName}}{{item.zhiwu=="0"?"":item.zhiwu}}{{item.endName}}巡查{{item.rnm==''?item.jc:item.rnm}}<span>{{item.unitsName}}</span>{{item.zgfXqmc==null?'':item.zgfXqmc}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span></span>
                   <span v-else-if="item.permission==3">{{titleTime(item.tIME)}}日{{item.dwName}}{{item.zhiwu=="0"?"":item.zhiwu}}{{item.endName}}巡查{{item.rnm==''?item.jc:item.rnm}}<span>{{item.unitsName}}</span>{{item.zgfXqmc==null?'':item.zgfXqmc}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span></span>
                   <span v-else-if="item.permission==6">{{titleTime(item.tIME)}}日{{item.dwName}}{{item.zhiwu=="0"?"":item.zhiwu}}{{item.endName}}巡查{{item.rnm==''?item.jc:item.rnm}}<span>{{item.unitsName}}</span>{{item.zgfXqmc==null?'':item.zgfXqmc}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span></span>
                   <span v-else>{{titleTime(item.tIME)}}日{{item.leftJc}}{{item.dwName}}{{item.zhiwu=="0"?"":item.zhiwu}}{{item.endName}}巡查{{item.rnm==''?item.jc:item.rnm}}<span>{{item.unitsName}}</span>{{item.zgfXqmc==null?'':item.zgfXqmc}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span></span>
                </div>
                <div class="item_left_top_item" v-else-if="item.lev==2 || item.lev==3 || item.lev==4">
                  <img src="../assets/images/logo5.png" alt class="img_list" />
                  <span>{{titleTime(item.tIME)}}日{{item.leftJc}}{{item.dwName}}{{item.zhiwu=="0"?"":item.zhiwu}}{{item.endName}}巡查{{item.rnm==''?item.jc:item.rnm}}<span>{{item.unitsName}}</span>{{item.zgfXqmc==null?'':item.zgfXqmc}}<span v-if="item.isok==1 || item.yhlb>0">发现隐患</span></span>
                </div>
                <div class="miaoshu">{{qiege(item.title)}}</div>
              </div>
              <div class="item_left_bottom">
                <div>
                  {{dateTime(item.addtime,new Date()).time}}
                  <img src="../assets/images/news.png" alt class="img_news"
                    v-show="dateTime(item.addtime,new Date()).show=='true'" />
                  <!-- <img src="../assets/images/news.png" alt="" class="img_news" v-show='dateTime(item.addtime,new Date()).show=='true''> -->
                </div>

                <div class="ren">
                  <img src="../assets/images/r_h.png" class="img_r" alt />
                  &nbsp;<span
                    v-if="item.patrolTroubleshoot==0 || item.patrolTroubleshoot==null || item.patrolTroubleshoot==''">{{item.userName}}</span>
                  <span v-else>{{item.userName}}</span>
                </div>
              </div>
            </div>
            <div class="ffdd">
              <img :src="img_qiege(item)" class="img_item" />
              <div class="zhezhao"></div>
            </div>
          </div>

          <div class="main_item"
            v-else-if=" ((item.jgconfigname != '信息报送' && item.type=='宣传部署') || item.jgconfigname=='应急演练'  )  && item.imgurl !=''">
            <div class="item_left">
              <div class="item_left_top">
                <div class="item_left_top_item" v-if="item.lev==0 || item.lev==-1">
                  <img src="../assets/images/yanpan.png" alt class="img_list" />
                  <span v-if="item.patrolTroubleshoot==0 || item.patrolTroubleshoot==null || item.patrolTroubleshoot==''">
                    <span
                      v-if="item.jgconfigname=='研判'">{{titleTime(item.tIME)}}日{{item.unitsName}}开展风险{{item.jgconfigname}}</span>
                    <span
                      v-else-if="item.jgconfigname=='部署'">{{titleTime(item.tIME)}}日{{item.unitsName}}开展安排{{item.jgconfigname}}</span>
                    <span
                      v-else-if="item.jgconfigname=='培训'">{{titleTime(item.tIME)}}日{{item.unitsName}}开展安全{{item.jgconfigname}}</span>
                    <span
                      v-else-if="item.jgconfigname=='约谈'">{{titleTime(item.tIME)}}日{{item.unitsName}}开展警示{{item.jgconfigname}}</span>
                    <span v-else-if="item.jgconfigname=='协调会'">{{titleTime(item.tIME)}}日{{item.unitsName}}开展隐患协调</span>
                    <span
                      v-else-if="item.jgconfigname=='现场宣传'">{{titleTime(item.tIME)}}日{{item.unitsName}}开展现场安全宣传</span>
                    <span v-else-if="item.jgconfigname=='应急演练'">
                      {{titleTime(item.tIME)}}日{{item.unitsName}}开展实战演练</span>

                  </span>
                  <span v-else>
                    <span v-if="item.jgconfigname=='风险研判' || item.jgconfigname=='报刊宣传'">
                      {{titleTime(item.tIME)}}日{{item.rnm?item.rnm:item.jc}}开展{{item.jgconfigname}}</span>
                    <span v-else-if="item.jgconfigname=='安排部署'">
                      {{titleTime(item.tIME)}}日{{item.rnm?item.rnm:item.jc}}开展{{item.jgconfigname}}</span>
                    <span v-else-if="item.jgconfigname=='安全培训'">
                      {{titleTime(item.tIME)}}日{{item.rnm?item.rnm:item.jc}}开展{{item.jgconfigname}}</span>
                    <span v-else-if="item.jgconfigname=='桌面推演'">
                      {{titleTime(item.tIME)}}日{{item.rnm?item.rnm:item.jc}}开展{{item.jgconfigname}}</span>
                    <span v-else-if="item.jgconfigname=='实战演练' || item.jgconfigname=='应急演练'">
                      {{titleTime(item.tIME)}}日{{item.rnm?item.rnm:item.jc}}开展实战演练</span>
                    <span v-else-if="item.jgconfigname=='隐患协调'">
                      {{titleTime(item.tIME)}}日{{item.rnm?item.rnm:item.jc}}开展{{item.jgconfigname}}</span>
                    <span v-else-if="item.jgconfigname=='现场安全宣传'">
                      {{titleTime(item.tIME)}}日{{item.rnm?item.rnm:item.jc}}开展{{item.jgconfigname}}</span>
                    <span v-else-if="item.jgconfigname=='入户安全宣传'">
                      {{titleTime(item.tIME)}}日{{item.rnm?item.rnm:item.jc}}开展{{item.jgconfigname}}</span>
                    <span v-else-if="item.jgconfigname=='网络安全宣传'">
                      {{titleTime(item.tIME)}}日{{item.rnm?item.rnm:item.jc}}开展{{item.jgconfigname}}</span>
                    <span v-else-if="item.jgconfigname=='警示约谈'">
                      {{titleTime(item.tIME)}}日{{item.rnm?item.rnm:item.jc}}开展{{item.jgconfigname}}</span>
                  </span>
                </div>
                <div class="item_left_top_item" v-else-if="item.lev==1 || item.lev==2 || item.lev==3 || item.lev==4">
                  <img src="../assets/images/yanpan.png" alt class="img_list" />
                  <span>{{titleTime(item.tIME)}}日{{item.leftJc}}{{item.dwName}}{{item.zhiwu=="0"?"":item.zhiwu}}{{item.endName}}组织{{item.jgconfigname}}</span>
                </div>
                <div class="miaoshu">{{qiege(item.title)}}</div>
              </div>
              <div class="item_left_bottom">
                <div>
                  {{dateTime(item.addtime,new Date()).time}}
                  <img src="../assets/images/news.png" alt class="img_news"
                    v-show="dateTime(item.addtime,new Date()).show=='true'" />
                </div>
                <div class="ren">
                  <img src="../assets/images/r_h.png" class="img_r" alt />
                  &nbsp;{{item.userName}}
                </div>
              </div>
            </div>
            <div class="ffdd">
              <img :src="img_qiege(item)" alt class="img_item" />
              <div class="zhezhao"></div>
            </div>
          </div>

        </div>
      </van-list>

      <!-- </van-pull-refresh> -->
    </div>

    <div class="content_box" v-if="fuck">
      <div class="content_box_song">
        <div class="fb">新版发布</div>
        <div class="savegg">应急安全管理平台最新版本发布啦,欢迎体验!</div>
        <div class="line"></div>
        <div class="makesure" @click="UPdatas">立即更新</div>
      </div>
    </div>

    <!-- 底部 -->
    <Tabbar id="yy" v-if="isOriginHei"></Tabbar>
  </div>
</template>

<script>
  import { Dialog } from "vant";
  import Header from "../components/header";
  import Tabbar from "../components/tabbar";
  import terminal from "../assets/js/terminal.js"
  export default {
    name: "index",
    data() {
      return {
        fuck: false,
        listArry: [
          {
            imgurl: require("../assets/images/img/b1.png"),
            txt: "监督检查计划",
            id: 0,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/b10.png"),
            txt: "三年行动",
            id: 10,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/b2.png"),
            txt: "任务交办",
            id: 1,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/b3.png"),
            txt: "宣传部署",
            id: 2,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/a4.png"),
            txt: "点位巡查",
            id: 9,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/b4.png"),
            txt: "巡查排查",
            id: 3,
            onclick: true,
            isShow: true,
          },

          {
            imgurl: require("../assets/images/img/b5.png"),
            txt: "隐患整治",
            id: 4,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/b6.png"),
            txt: "辖企档案",
            id: 5,
            onclick: true,
            isShow: true,
          },

          {
            imgurl: require("../assets/images/img/b9.png"),
            txt: "目标考核",
            id: 8,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/b8.png"),
            txt: "数据地图",
            id: 7,
            onclick: true,
            isShow: true,
          },
          // {
          //   imgurl: require("../assets/images/img/a4.png"),
          //   txt: "点位巡查",
          //   id: 9,
          //   onclick: true,
          //   isShow: false,
          // },

        ],
        listArry_1: [
          {
            imgurl: require("../assets/images/img/b1.png"),
            txt: "监督检查计划",
            id: 0,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/b10.png"),
            txt: "三年行动",
            id: 10,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/b2.png"),
            txt: "任务交办",
            id: 1,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/b3.png"),
            txt: "宣传部署",
            id: 2,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/a4.png"),
            txt: "点位巡查",
            id: 9,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/b4.png"),
            txt: "巡查排查",
            id: 3,
            onclick: true,
            isShow: true,
          },

          {
            imgurl: require("../assets/images/img/b5.png"),
            txt: "隐患整治",
            id: 4,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/b6.png"),
            txt: "辖企档案",
            id: 5,
            onclick: true,
            isShow: true,
          },

          {
            imgurl: require("../assets/images/img/b9.png"),
            txt: "目标考核",
            id: 8,
            onclick: true,
            isShow: true,
          },
          {
            imgurl: require("../assets/images/img/b8.png"),
            txt: "数据地图",
            id: 7,
            onclick: true,
            isShow: true,
          },
          // {
          //   imgurl: require("../assets/images/img/a4.png"),
          //   txt: "点位巡查",
          //   id: 9,
          //   onclick: true,
          //   isShow: false,
          // },

        ],
        lie_cont: 4,
        zongshu: 10,
        mbkh_show: false,
        dwxc_show: false,
        show: false,
        isshow: false,
        sort: 0, //app版本是否需要更新的状态变量
        phone_type: null, //判断手机是什么系统,0为ios，1为安卓
        data_repa: [],
        red_is: false,
        red_is_rwjb: false,
        userId: null,
        tel: null,
        geshu: 0,
        url: "",
        wgtVersion: "", //版本号
        cardWhether: null, //是否身份证验证
        path: null,
        showeditionObj: null,
        rank: null, //等级 区级、街道、科室、社区
        clickNum: 0,
        search_ss: "", //输入框的值
        search_inpt_bg_is: false,
        yinchang: true, //小模块显示
        scroll: 0,
        cunt: 1,
        list: [], //新闻列
        img_path: "http://219.153.71.175:8015/yzssapp",
        loading: false, //加载状态结束false
        finished: false, //全部加载完成true
        error: false, //出错状态
        refreshing: false, //是否下拉加载 是true
        total: null,
        xcbslist: [
          "风险研判",
          "安排部署",
          "安全培训",
          "桌面推演",
          "实战演练",
          "隐患协调",
          "现场安全宣传",
          "入户安全宣传",
          "网络安全宣传",
          "警示约谈",
        ], //宣传布署对象
        documentHeight: document.documentElement.clientHeight,
        isOriginHei: true, //显示或者隐藏footer
        celist: [
          {
            title: "头部完头部完头部完头部完头部完头部完头1",
            ft: "部完头部完头部完头部完头部完头部完头部完头部完头",
          },
          {
            title: "头部完头部完头部完头",
            ft:
              "部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头部完头",
          },
        ],
        isActive: '',
        boxHeight: 0,
        isok: false,//是否请求完
        box_h: 0,
        fic: '',//监督检查计划的title
        is_noe: 4,
        date_me: null,
      };
    },
    mounted() {
      var _this = this;
      document.addEventListener("scroll", this.scrollfunc, true);
      window.onresize = () => {
        return (() => {
          if (this.documentHeight > document.documentElement.clientHeight) {
            this.isOriginHei = false;
          } else {
            this.isOriginHei = true;
          }
        })();
      };
      $("#yy .van-tabbar-item--active").click(function () {
        _this.search_ss = "";
        _this.search_inpt_bg_is = false;
        _this.list = [];
        _this.onRefresh();
        _this.isactive();

      })
      // console.log("当前时间：=============",date)
    },
    // destroyed() {
    //   window.removeEventListener("popstate", this.back, false); //false阻止默认事件
    // },
    methods: {
      search_xx() {
        this.search_ss = "";
        this.search_inpt_bg_is = false;
      },
      shijianqie(value) {
        if (value.substring(0, 1) == "0") {
          return value.substring(1, 5);
        }
      },
      qiege(str, title) {
        str += "";
        if (str == "") {
          return false;
        }
        if (str.length > 14 && str.length != 0) {
          return str.substring(0, 14) + "...";
        } else {
          return str;
        }
        // if (str.length > 14) {
        //   return str.substring(0, 14) + "...";
        // } else {
        //   return str
        // }

        // if (title.length > 12) {
        //   return str.substring(0, 14) + "...";
        // } else {
        //   return str.substring(0, 28) + "...";
        // }
      },
      img_qiege(item) {
        if (item.patrolTroubleshoot==0 || item.patrolTroubleshoot==null || item.patrolTroubleshoot=='') {
          if (item.imgurl.indexOf('^') != -1) {
            return this.img_path1 + item.imgurl.split("^^")[0];
          } else {

            return this.img_path + item.imgurl.split(",")[0];
          }

        } else {
          return this.img_path + item.imgurl.split(",")[0];
        }
        // return i.split(",")[0];
      },
      btn(item) {
        console.log(item);
        sessionStorage.setItem("showed", 2);
        // console.log(this.xcbslist.indexOf(item.type));
        localStorage.setItem("index_scroll", this.scroll);
        // localStorage.setItem("userId", item.userId);
        if (item.type == '巡查排查' || item.type == '消防安全' || item.type == '生产安全' || item.type == '房屋建筑' || item.type == '自然灾害' || item.type == '其他安全') {
          console.log("巡查排查")
          sessionStorage.setItem("inspection_patrolTroubleshootId", item.patrolTroubleshoot);
          if (item.isok == 0) {
            sessionStorage.setItem("inspection_infoId", 0);
          } else {
            sessionStorage.setItem("inspection_infoId", item.patrolTroubleshootInfoId);
          }
          localStorage.setItem("hard_detail_from", "/index");

          if (item.patrolTroubleshoot==0 || item.patrolTroubleshoot==null || item.patrolTroubleshoot=='') {
            localStorage.setItem('hard_detail_from', '/index')
            this.$router.push({
              path: '/ptlook',
              query: { id: item.id, ids: 14 }
            });
          } else {
            this.$router.push("/hard_detail");
          }
        } else if (item.jgconfigname != '信息报送' && item.type != '巡查排查') {
          console.log("宣传布署")
          var kfc = {
            id: item.id,
            lujing: "index",
          };
          sessionStorage.setItem("todetail", JSON.stringify(kfc));
          if (item.patrolTroubleshoot==0 || item.patrolTroubleshoot==null || item.patrolTroubleshoot=='') {
            localStorage.setItem('hard_detail_from', '/index')
            this.$router.push({
              path: '/hard_detail_ordinary',
              query: { id: item.id, ids: 11 }
            });
          } else {
            kfc.id = item.patrolTroubleshoot;
            sessionStorage.setItem("todetail", JSON.stringify(kfc));
            this.$router.push("/xcbs_detail");
          }

        }
      },
      titleTime(value) {
        // return value
        var str = value.replace("-", "月");
        if (str.substring(0, 1) == "0") {
          return str.substring(1, 5);
        } else {
          return str;
        }
      },
      scrollfunc() {
        var scroll_1 = $(".content").scrollTop();
        // console.log(scroll_1)
        this.boxHeight = $(".hede").height()
        // console.log(this.boxHeight)
        var box_h = Number($(".header_top").attr("data-margin"))

        // console.log("=============top:",box_h)
        if (scroll_1 == 0) {
          $(".header_top").css({ "margin-top": 0 })
          $(".header_top").attr("data-margin", 0)
          // $(".zhanswei").css({"opacity":0})
        }
        if (scroll_1) {
          if (this.scroll > scroll_1) {//下滑
            console.log("d===========================.", terminal.terminals().android)
            if (terminal.terminals().android !== true) {//ios
              if ($(".main-index").height() - scroll_1 > 805 && box_h + (this.scroll - scroll_1) < 0) {
                this.box_h = box_h + (this.scroll - scroll_1)
                $(".header_top").css({ "margin-top": box_h + (this.scroll - scroll_1) })
                $(".header_top").attr("data-margin", box_h + (this.scroll - scroll_1))
                $(".hede").css({ "opacity": (box_h + this.boxHeight) / this.boxHeight })
                $(".zhanswei").css({ "opacity": -box_h / this.boxHeight })
              }
            } else {
              if (box_h + (this.scroll - scroll_1) < 0) {
                this.box_h = box_h + (this.scroll - scroll_1)
                $(".header_top").css({ "margin-top": box_h + (this.scroll - scroll_1) })
                $(".header_top").attr("data-margin", box_h + (this.scroll - scroll_1))
                $(".hede").css({ "opacity": (box_h + this.boxHeight) / this.boxHeight })
                $(".zhanswei").css({ "opacity": -box_h / this.boxHeight })
              }

            }
            // this.yinchang = true;
          } else {//上拉
            // console.log(this.boxHeight)
            // console.log(-box_h<=this.boxHeight+10)
            if (terminal.terminals().android !== true) {//ios
              if (-box_h <= this.boxHeight + 10 && scroll_1 > 300) {
                this.box_h = box_h - (scroll_1 - this.scroll)
                $(".header_top").css({ "margin-top": box_h - (scroll_1 - this.scroll) })
                $(".header_top").attr("data-margin", box_h - (scroll_1 - this.scroll))
                $(".hede").css({ "opacity": 1 + box_h / this.boxHeight })
                $(".zhanswei").css({ "opacity": -box_h / this.boxHeight })
                // console.log(124)
              }
            } else {
              if (-box_h <= this.boxHeight + 10) {
                this.box_h = box_h - (scroll_1 - this.scroll)
                $(".header_top").css({ "margin-top": box_h - (scroll_1 - this.scroll) })
                $(".header_top").attr("data-margin", box_h - (scroll_1 - this.scroll))
                $(".hede").css({ "opacity": 1 + box_h / this.boxHeight })
                $(".zhanswei").css({ "opacity": -box_h / this.boxHeight })
                // console.log(124)
              }
            }

            // this.yinchang = false;
          }
          this.scroll = scroll_1;
        }

        // if (-box_h < 5) {
        //   $(".zhanswei").css({ "opacity": 0 })
        //   $(".hede").css({"opacity":1})
        // }
        // if (-box_h > 274) {
        //   $(".zhanswei").css({ "opacity": 1 })
        //   $(".hede").css({"opacity":0})
        // }


        // console.log(this.scroll);
      },

      scan() {
        //  扫一扫
        // this.show=false
        sessionStorage.removeItem("qujiname");
        sessionStorage.removeItem("jiedaoname");
        sessionStorage.removeItem("shequname");
        sessionStorage.removeItem("number");
        sessionStorage.removeItem("yeschuan");
        sessionStorage.removeItem("str");
        sessionStorage.removeItem("fidname");
        sessionStorage.removeItem("didname");
        localStorage.removeItem("xcpc_da_obj");
        localStorage.removeItem("xcdx_map_xcdxObj");
        localStorage.setItem("xcpc_scan_fanhui", "/index");
        this.$router.push("/xcpc_scan");
      },
      filterFun(value) {
        if (value && value.length > 49) {
          value = value.substring(0, 49) + "...";
        }
        return value;
      },
      dateTime(start, current) { //时间过滤
        var str = start;
        var result = ""
        var obj = {}
        //将字符串转换成时间格式
        var timePublish = new Date(str);
        var timeNow = new Date(current);
        var minute = 1000 * 60;
        var hour = minute * 60;
        var day = hour * 24;
        var month = day * 30;
        var diffValue = timeNow - timePublish;
        var diffMonth = diffValue / month;
        var diffWeek = diffValue / (7 * day);
        var diffDay = diffValue / day;
        var diffHour = diffValue / hour;
        var diffMinute = diffValue / minute;

        if (diffValue < 0) {
          alert("错误时间");
        } else if (diffDay > 2) {
          // result = timePublish.getFullYear() + "年";
          result += timePublish.getMonth() + 1 + "月";
          result += timePublish.getDate() + "日";
          // alert(result);
          obj = {
            "time": result,
            "show": "false"
          }
        } else if (diffDay > 1) {
          result = parseInt(diffDay) + "天前";
          obj = {
            "time": result,
            "show": "false"
          }
        } else if (diffHour > 3 || diffHour == 3) {
          // console.log("小时：", diffHour)
          result = parseInt(diffHour) + "小时前";
          obj = {
            "time": result,
            "show": "false"
          }
        } else if (diffHour > 1) {
          // console.log("小时：", diffHour)
          result = parseInt(diffHour) + "小时前";
          obj = {
            "time": result,
            "show": "true"
          }
        } else if (diffMinute > 1) {
          result = parseInt(diffMinute) + "分钟前";
          obj = {
            "time": result,
            "show": "true"
          }
        } else {
          result = "刚刚";
          obj = {
            "time": result,
            "show": "true"
          }
        }
        // console.log(obj)
        return obj;
      },
      // blurinpt(){
      //   this.search_inpt_bg_is = false
      //   if (this.search_ss.length != "") {
      //     this.search_inpt_bg_is = true
      //   }
      // },
      focusinpt() {
        console.log(111)
        $(".content").animate(
          { scrollTop: Number(this.scroll) + 10 },
          0
        );
        $(".content").animate(
          { scrollTop: Number(this.scroll) },
          0
        );
      },
      changeInput() {
        //监听input 值
        if (this.search_ss.length == "") {
          this.search_inpt_bg_is = false;
        } else {
          this.search_inpt_bg_is = true;
        }

        // console.log(this.search_ss)
      },
      open() {
        this.hidshow = false;
      },
      lose() {
        this.hidshow = true;
      },
      back() {
        var _this = this;
        _this.clickNum++;
        if (_this.clickNum > 1) {
          plus.runtime.quit();
        } else if (_this.clickNum == 1) {
          _this.mui.toast("再按一次退出应用");
        }
        setTimeout(function () {
          _this.clickNum = 0;
        }, 1000);
        return false;
      },

      checkRwjb() {
        var _this = this;
        var params = {
          userId: _this.userId,
        };
        _this.axios
          .get(_this.$global_msg.Url.host + "/taskAssign/showIsCheck", {
            params: params,
          })
          .then(function (data) {
            try {
              plus.nativeUI.closeWaiting();
            } catch (e) {
              console.log(e.message);
            }
            console.log("selectNineStoreById:", data);
            if (data && data.data) {
              if (data.data.code == 200) {
                _this.red_is_rwjb = data.data.rows == 1 ? true : false;
              } else {
                var http = _this.$global_msg.Url.host + "/taskAssign/showIsCheck?userId=" + _this.userId;
                // _this.$error_._error(http, "web", error)
                // _this.$toast(data.data.msg);
              }
            } else {
              _this.$toast("查询失败");
            }
          });
      },
      down_apk() {
        var _this = this;
        var Terminal = {
          // 辨别移动终端类型
          platform: (function () {
            var u = navigator.userAgent,
              app = navigator.appVersion;
            return {
              // android终端或者uc浏览器
              android: u.indexOf("Android") > -1 || u.indexOf("Linux") > -1,
              // 是否为iPhone或者QQHD浏览器
              iPhone: u.indexOf("iPhone") > -1,
              // 是否iPad
              iPad: u.indexOf("iPad") > -1,
            };
          })(),
          // 辨别移动终端的语言：zh-cn、en-us、ko-kr、ja-jp...
          language: (
            navigator.browserLanguage || navigator.language
          ).toLowerCase(),
        };
        // 根据不同的终端，跳转到不同的地址
        var theUrl = "";
        if (Terminal.platform.android) {
          // alert("安卓")
          theUrl = _this.showeditionObj.xzgxUrl;
          if (is_mobileWX() || is_mobileQQForAndroid()) {
          } else {
            location.href = theUrl;
          }
        } else if (Terminal.platform.iPhone) {
          theUrl = "https://itunes.apple.com/us/app/998dian-wan-cheng/id1527965084?mt=8";
          location.href = theUrl;
        }

        function is_mobileQQForAndroid() {
          var ua = navigator.userAgent.toLowerCase();
          if (ua.match(/\sQQ/i) == "qq" && /iphone/i.test(ua) == false) {
            return true;
          } else {
            return false;
          }
        }

        function is_mobileQQForIPhone() {
          var ua = navigator.userAgent.toLowerCase();
          if (ua.match(/\sQQ/i) == "qq" && /iphone/i.test(ua) == true) {
            return true;
          } else {
            return false;
          }
        }

        function is_mobileWX() {
          var ua = navigator.userAgent.toLowerCase();
          if (ua.match(/MicroMessenger/i) == "micromessenger") {
            return true;
          } else {
            return false;
          }
        }
      },
      UPdatas() {
        this.down_apk();
      },
      showed(index, id) {
        console.log(index, id);
        sessionStorage.setItem("showed", 1);
        if (id === 0) {
          //监督检查计划
          // 2865
          var name = localStorage.getItem("super");
          if (this.fjc == '') {
            return false
          }
          sessionStorage.setItem("jdjc_tongji_title", this.fjc);
          if (this.rank == 1) {
            this.$router.push("/tongji_1");
          } else if (this.rank == 2) {
            this.$router.push("/tongji_2");
          } else if (this.rank == 3) {
            this.$router.push("/tongji_3");
          }
        } else if (id === 1) {
          //任务交办
          localStorage.removeItem("rwjbDwType");
          this.$router.push("/rwjb_list");
        } else if (id === 2) {
          //宣传部署
          // sessionStorage.setItem("where", 0);
          // this.$router.push("/xcbs_list");
          sessionStorage.removeItem('time')
          this.$router.push({
            path: '/statistical'
          })
        } else if (id === 3) {
          //巡查排查
          sessionStorage.removeItem('time')
          this.$router.push("/statistical_patrol");
        } else if (id === 5) {
          //辖企档案
          this.$router.push("/xqda");
        } else if (id === 4) {
          //隐患整治
          this.axios
            .get(
              `${this.$global_msg.Url.host}/taskAssign/isPostOrGet?userId=${this.userId}`
            )
            .then((res) => {
              console.log(res);
                localStorage.setItem('yhzz_quanxian', res.data.rows)
              if (res.data.rows == 0) {
               
                this.$router.push("/yhzz_btn");
              } else if (res.data.rows == 1 || res.data.rows == 3) {
                this.$router.push("/yhzz_btn1");
              } else if (res.data.rows == 2) {
                this.$router.push("/yhzz_btn2");
              }else if(res.data.rows == 5|| res.data.rows == 4){
                 this.$router.push("/yhzz_keshi");
              }
            });
        } else if (id === 8) {
          this.$router.push("/mbkh");
          //目标考核
        } else if (id === 7) {
          //数据地图
          this.$router.push("/data_map");
        } else if (id === 9) {
          //点位巡查
          localStorage.setItem("dwxc_1_time", "")
          this.$router.push("/dwxc_1_calendar");
        } else if (id === 10) {
          //三年行动计划
          // this.$toast("暂未上线");
          // return;

          var _this = this;
          try {
            plus.nativeUI.showWaiting("正在加载...");
          } catch (e) {
            console.log(e.message);
          }
          _this.axios.get(_this.$global_msg.Url.host + "/ThreeYearsController/selectUserPermission", {
            params: {
              userId: _this.userId
            }
          }).then(function (data) {
            try {
              plus.nativeUI.closeWaiting();
            } catch (e) {
              console.log(e.message);
            }
            console.log('selectStreetAndCommunity:', data);
            localStorage.setItem('quanxian', data.data.rows.permission)
            localStorage.setItem('fid', data.data.rows.id)
            console.log()
            if (data.data.code == 200) {
                sessionStorage.removeItem("guanlian");
              console.log(data.data.rows.permission)
              if (data.data.rows.permission === 0 || data.data.rows.permission === '0') {//区级
                localStorage.setItem("snxd_qx", '区级');
                _this.$router.push("/snxd_tongji");
                //  _this.$router.push("/snxd_list");
              } else if (data.data.rows.permission === 1 || data.data.rows.permission === '1') {//街道
                localStorage.setItem("snxd_qx", '街道');
                _this.$router.push("/snxd_tongji");
              } else if (data.data.rows.permission === 2 || data.data.rows.permission === '2') {//社区
                localStorage.removeItem("snxd_dwid")
                localStorage.removeItem("years")
                localStorage.setItem("snxd_qx", '社区');
                _this.$router.push("/snxd_list");
              } else if (data.data.rows.permission === 6 || data.data.rows.permission === '6') {//部门
                localStorage.setItem("snxd_qx", '部门');
                localStorage.removeItem("years")
                localStorage.removeItem("snxd_dwid")
                _this.$router.push("/snxd_list");
              } else if (data.data.rows.permission === 3 || data.data.rows.permission === '3') {//科室
                if (data.data.rows.code == 1) {
                  localStorage.setItem("keshishuzi", data.data.rows.code)
                  console.log("跳")
                  localStorage.setItem("snxd_qx", '科室');
                  // localStorage.removeItem("years")
                  // localStorage.removeItem("snxd_dwid")
                  _this.$router.push("/snxd_tongji");
                } else if (data.data.rows.code == 100) {
                  localStorage.setItem("keshishuzi", data.data.rows.code)
                  console.log("不跳")
                  localStorage.setItem("snxd_qx", '科室');
                  localStorage.removeItem("years")
                  localStorage.removeItem("snxd_dwid")
                  _this.$router.push("/snxd_list");
                }

              } else {
                _this.$toast('查询失败');
              }
            }
          });
        }
      },
      ismobile(test) {
        var u = navigator.userAgent,
          app = navigator.appVersion;
        if (
          /AppleWebKit.*Mobile/i.test(navigator.userAgent) ||
          /MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(
            navigator.userAgent
          )
        ) {
          if (window.location.href.indexOf("?mobile") < 0) {
            try {
              if (/iPhone|mac|iPod|iPad/i.test(navigator.userAgent)) {
                // return "0";
                this.phone_type = 0;
                // alert("iphone")
              } else {
                // return "1";
                this.phone_type = 1;
                // alert("Android")
              }
            } catch (e) { }
          }
        } else if (u.indexOf("iPad") > -1) {
          // return "0";
          this.phone_type = 0;
          // alert("iphone")
        } else {
          // return "1";
          this.phone_type = 1;
          // alert("Android")
        }
      },
      //更新方法
      UpdateSystem() {
        if (this.sort == 0) {
          this.plusReady_gengxin();
        } else if (this.sort == 1) {
          this.plusReady_gengxin();
        }
      },
      // 更新方法
      plusReady_gengxin() {
        this.runtime_fun();
      },
      runtime_fun() {
        var _this = this;
        setTimeout(() => {
          plus.runtime.getProperty(plus.runtime.appid, function (inf) {
            // 当前版本

            var wgtVersion = inf.version;
            _this.axios
              .get(
                "/showedition",
                {},
                {
                  headers: {
                    "Content-Type": "application/x-www-form-urlencoded",
                  },
                }
              )
              .then(function (data) {
                // 如果有新版本，则提示需要更新
                console.log("aaaa");
                console.log(data.data.rows.zdgxNumber);
                console.log(wgtVersion);
                console.log(data.data.rows.zdgxNumber > wgtVersion);
                _this.showeditionObj = data.data.rows;
                if (data.data.rows.xzgxNumber > wgtVersion) {
                  _this.fuck = true;
                } else if (data.data.rows.zdgxNumber > wgtVersion) {
                  console.log(11111);
                  _this.$toast("有新版本可用");
                  setTimeout(() => {
                    console.log(2222);
                    _this.downloadWgt(); // 下载wgt方法
                  }, 1000);
                } else {
                  if (_this.sort == 1) {
                    console.log(33333);
                    // _this.Toast({
                    //   message: "已是最新版本！！！",
                    //   className: "toast_font"
                    // });
                    console.log("已是最新版本！！！");
                  } else {
                    return;
                  }
                }
              })
              .catch(function (err) {
                // 请求失败处理
                _this.$toast("获取更新资源失败！！！");
                var http = "http没加" + "/showedition";
                _this.$error_._error(http, "web获取更新资源失败！！！", error)
              });
          });
        }, 500);
      },
      // 下载wgt方法
      downloadWgt() {
        // 更新文件 wgt 文件地址
        var that = this;
        var wgtUrl = that.showeditionObj.zdgxUrl;
        plus.nativeUI.showWaiting("正在更新...");
        plus.downloader
          .createDownload(
            wgtUrl,
            {
              filename: "_doc/update/",
            },
            function (d, status) {
              if (status == 200) {
                console.log("下载wgt成功：" + d.filename);
                that.installWgt(d.filename); // 安装wgt方法
              } else {
                console.log("下载wgt失败！");
                plus.nativeUI.alert("下载wgt失败！");
              }
              plus.nativeUI.closeWaiting();
            }
          )
          .start();
      },
      //安装方法
      installWgt(path) {
        plus.nativeUI.showWaiting("安装wgt文件...");
        plus.runtime.install(
          path,
          {},
          function () {
            plus.nativeUI.closeWaiting();
            console.log("安装wgt文件成功！");
            plus.nativeUI.alert("应用资源更新完成！", function () {
              plus.runtime.restart();
            });
          },
          function (e) {
            plus.nativeUI.closeWaiting();
            console.log("安装wgt文件失败[" + e.code + "]：" + e.message);
            plus.nativeUI.alert("安装wgt文件失败[" + e.code + "]：" + e.message);
          }
        );
      },
      indexrank() {
        this.axios
          .get(
            `${this.$global_msg.Url.host}/monitoringPlan/isRight?userId=${this.userId}`
          )
          .then((res) => {
            console.log("权限级别", res);

            if (res.data.code != 200) {
              var http = `${this.$global_msg.Url.host}/monitoringPlan/isRight?userId=${this.userId}`;
              this.$error_._error(http, "java", res.data.code + ":" + res.data.msg)
            }


            this.fjc = res.data.rows.fjc

            if (this.fjc == "区安委会") {
              this.fjc = "渝中区"
            }

            if (res.data.rows.dwlev == 0) {
              //区级
              this.rank = 1;
              sessionStorage.setItem("index_rank", 1);
            } else if (res.data.rows.dwlev == 1) {
              //街道
              this.rank = 2;
              sessionStorage.setItem("index_rank", 2);
            } else if (res.data.rows.dwlev == 2) {
              //社区、科室
              if (res.data.rows.dwlxid == 1) {
                //科室
                this.rank = 2;
                sessionStorage.setItem("index_rank", 2);
              } else {
                //社区
                this.rank = 3;
                sessionStorage.setItem("index_rank", 3);
              }
            } else if (res.data.rows.dwlev == 3) {
              //企业
              this.rank = 4;
              sessionStorage.setItem("index_rank", 4);
            }
          }).catch((error) => {
            try {
              plus.nativeUI.closeWaiting();
            } catch (e) {
              console.log("plus问题");
            }
            let err = error.message;
            if (err === "Network Error") {
              this.$toast("网络异常!");
            }else if (err.includes("timeout")) {
              this.$toast("网络超时，请重试！");
            } else {
              console.log(error.message)
            }
            var http = `${this.$global_msg.Url.host}/monitoringPlan/isRight?userId=${this.userId}`;
            // this.$error_._error(http, "web", error)
          });;
      },
      getlist() {
        var that = this
        // try {
        //   plus.nativeUI.showWaiting("正在加载...");
        // } catch (e) {
        //   console.log(e.message);
        // }
        this.axios
          .get(
            `${this.$global_msg.Url.host}/SearchScreen/selectIndexQueryName?userId=${this.userId}&queryName=${this.search_ss}&pageSize=${this.cunt}&pageRows=10`,
            {
              headers: {
                "Content-Type": "application/json",
              },
            }
          )
          .then((res) => {
            try {
              plus.nativeUI.closeWaiting();
            } catch (e) {
              console.log(e.message);
            }
            if (res.data.code == -1 || res.data.code == 1) {
              this.loading = false;
              this.$toast(res.data.msg);
              this.finished = true;
              var http = `${this.$global_msg.Url.host}/SearchScreen/selectIndexQueryName?userId=${this.userId}&queryName=${this.search_ss}&pageSize=${this.cunt}&pageRows=10`;
              this.$error_._error(http, "java", res.data.code + ":" + res.data.msg)

              return false;
            }
            console.log("新闻列表：", res);
            console.log("=================");
            if (res.data.rows.length == 0) {
              this.loading = false;
              this.$toast("暂无数据");
              this.finished = true;
              return false;
            }
            if (this.refreshing) {
              this.list = [];
              this.cunt = 1;
              this.refreshing = false;
            }

            // this.list = res.data.rows
            for (var i of res.data.rows) {
              // this.list=res.data.rows.list
              this.list.push(i);
            }
            // this.total = res.data.total;

            this.cunt += 1;
            // 加载状态结束
            this.loading = false;
            console.log(this.list.length);
            if (res.data.rows.length < 10) {
              this.finished = true;
              this.$toast("加载完毕");
              // console.log("加载完毕");
            }
          })
          .catch((error) => {
            try {
              plus.nativeUI.closeWaiting();
            } catch (e) {
              console.log("plus问题");
            }
            console.log(error.message);
            let err = error.message;
            if (err === "Network Error") {
              this.$toast("网络异常!");
            }else if (err.includes("timeout")) {
              this.$toast("网络超时，请重试！");
            } else {
              console.log(error.message)
            }

            var http = `${this.$global_msg.Url.host}/SearchScreen/selectIndexQueryName?userId=${this.userId}&queryName=${this.search_ss}&pageSize=${this.cunt}&pageRows=10`;
            // this.$error_._error(http, "web", error)
          });
      },
      onLoad() {
        // 异步更新数据
        // this.yc = true
        // if(this.cunt>2){return false}

        this.getlist();
      },
      onRefresh() {
        $(".content").animate({ scrollTop: 0 }, 0);
        console.log("下拉");
        // 清空列表数据
        this.finished = false;
        this.refreshing = true;
        // this.yc=false
        // 重新加载数据
        // 将 loading 设置为 true，表示处于加载状态
        this.loading = true;
        this.cunt = 1;
        try {
          plus.nativeUI.showWaiting("正在加载...");
        } catch (e) {
          console.log("plus问题");
        }
        this.onLoad();
      },
      isactive() {//目标考核权限
        var that = this
        try {
          plus.nativeUI.showWaiting("正在加载...");
        } catch (e) {
          console.log("plus问题");
        }
        this.axios
          .get(
            this.$global_msg.Url.host +
            "/taskAssign/isPostOrGet?userId=" +
            this.userId
          )
          .then(res => {
            try {
              plus.nativeUI.closeWaiting();
            } catch (e) {
              console.log("plus问题");
            }


            this.zongshu = 10
            this.geshu = 0
            console.log("目标考核", res);
            this.isActive = res.data.rows;
            if (res.data.rows == 2) {
              // this.mbkh_show = false
              // this.listArry[8].isShow = false
              this.geshu = this.geshu + 1;
              this.listArry_1.forEach((item, i) => {
                if (item.id == 8) {
                  item.isShow = false
                }
              })

            } else {
              this.listArry_1.forEach((item, i) => {
                if (item.id == 8) {
                  item.isShow = true
                }
              })
            }
            this.isdwxc()
            if (res.data.code != 200) {
              var http = this.$global_msg.Url.host + "/taskAssign/isPostOrGet?userId=" + this.userId;
              this.$error_._error(http, "java", res.data.code + ":" + res.data.msg)
            }

          })
          .catch((error) => {
            try {
              plus.nativeUI.closeWaiting();
            } catch (e) {
              console.log("plus问题");
            }
            let err = error.message;
            if (err === "Network Error") {
              this.$toast("网络异常!");
            }else if (err.includes("timeout")) {
              this.$toast("网络超时，请重试！");
            } else {
              console.log(error.message)
            }
            var http = this.$global_msg.Url.host + "/taskAssign/isPostOrGet?userId=" + this.userId;
            // this.$error_._error(http, "web", error)
          });

      },
      isdwxc() {//点位巡查权限
        try {
          plus.nativeUI.showWaiting("正在加载...");
        } catch (e) {
          console.log("plus问题");
        }
        this.axios
          .get(
            this.$global_msg.Url.host +
            "/fModule/showpcqx?userid=" +
            this.userId
          )
          .then(res => {
            try {
              plus.nativeUI.closeWaiting();
            } catch (e) {
              console.log("plus问题");
            }
            console.log("点位巡查", res);
            if (res.data.code == 200) {// 1 有 0 无
              if (res.data.rows == 0) {
                this.dwxc_show = false
                // this.listArry[4].isShow = false
                this.geshu = this.geshu + 1;
                console.log("隐藏总数", this.geshu)
                this.listArry_1.forEach((item, i) => {
                  if (item.id == 9) {
                    item.isShow = false
                  }
                })
              } else {
                this.listArry_1.forEach((item, i) => {
                  if (item.id == 9) {
                    item.isShow = true
                  }
                })
              }
              this.isok = true

              this.snxd();

              // $(".header_top").css({ "margin-top": 0 })
              // $(".header_top").attr("data-margin", 0)
              // $(".zhanswei").css({ "opacity": 0 })
              // $(".hede").css({ "opacity": 1 })
            } else {
              this.$toast(res.data.msg);
              var http = this.$global_msg.Url.host + "/fModule/showpcqx?userid=" + this.userId
              this.$error_._error(http, "java", error)
            }
          })
          .catch((error) => {
            try {
              plus.nativeUI.closeWaiting();
            } catch (e) {
              console.log("plus问题");
            }
            let err = error.message;
            if (err === "Network Error") {
              this.$toast("网络异常!");
            }else if (err.includes("timeout")) {
              this.$toast("网络超时，请重试！");
            } else {
              console.log(error.message)
            }
            var http = this.$global_msg.Url.host + "/fModule/showpcqx?userid=" + this.userId
            // this.$error_._error(http, "web", error)
          });
      },
      snxd() {//三年行动
        var _this = this
        this.axios.get(
          `${this.$global_msg.Url.host}/fModule/showSNXDqx?userid=${this.userId}`
        )
          .then((res) => {
            console.log("三年新东", res)
            if (res.data.code == 200) {

              if (res.data.rows == 0) {
                this.isActive = res.data.rows;
                this.geshu = this.geshu + 1;
                this.listArry_1.forEach((item, i) => {
                  if (item.id == 10) {
                    item.isShow = false
                  }
                });

              } else {
                this.listArry_1.forEach((item, i) => {
                  if (item.id == 10) {
                    item.isShow = true
                  }
                });
              }
              console.log("总数listArry_1：", this.listArry_1)
              this.listArry = []
              this.listArry_1.forEach((item, i) => {
                this.listArry.push(item)
              });

              this.listArry.forEach((item, i) => {
                if (!item.isShow) {
                  this.listArry.splice(i, 1)
                }
                // console.log(item,i)
              });

              this.zongshu = this.listArry.length
              if (this.zongshu > 8) {
                this.lie_cont = 5
                if (this.zongshu == 10) {
                  this.is_noe = 5
                } else {
                  this.is_noe = 4
                }
              } else {
                this.lie_cont = 4
                this.is_noe = 4
              }
              console.log("一排多少个：", this.lie_cont)
              console.log("总数多少个：", this.zongshu)
              console.log("总数list：", this.listArry)

            } else {
              var http = this.$global_msg.Url.host + "/fModule/showSNXDqx?userid=" + this.userId;
              this.$error_._error(http, "java", res.data.code + ":" + res.data.msg)
            }

          }).catch((error) => {
            try {
              plus.nativeUI.closeWaiting();
            } catch (e) {
              console.log("plus问题");
            }
            let err = error.message;
            if (err === "Network Error") {
              this.$toast("网络异常!");
            }else if (err.includes("timeout")) {
              this.$toast("网络超时，请重试！");
            } else {
              console.log(error.message)
            }
            var http = this.$global_msg.Url.host + "/fModule/showSNXDqx?userid=" + this.userId;
            // this.$error_._error(http, "web", error)
          });


      },
      DateMinus(date1, date2) {
        var sdate = new Date(date1);
        var now = new Date(date2);
        var days = now.getTime() - sdate.getTime();
        var day = parseInt(days / (1000 * 60 * 60 * 24));
        return day;
      },
      isLogin() {
        var LoginInfo = localStorage.getItem("newTime_1");
        if (LoginInfo != "" || LoginInfo != undefined) {
          var time1 = LoginInfo;
          var time2 = new Date();
          var days = this.DateMinus(time1, time2);
          console.log("这是登录第" + days + "天");
          if (days < 7) {
            localStorage.setItem("newTime_1",new Date())
           } else {
            this.$router.push("/login");
            localStorage.clear();
          }
        } else {
          this.$router.push("/login");
          localStorage.clear();
        }
      },

    },
    watch: {
      dwxc_show: function (newVal, oldVal) {

        console.log((newVal + "--" + oldVal));
      },
      box_h: function (newVal, oldVal) {
        console.log(this.box_h)
        if (-newVal < 5) {
          $(".zhanswei").css({ "opacity": 0 })
          $(".hede").css({ "opacity": 1 })
        }
        if (-newVal > 274) {
          $(".zhanswei").css({ "opacity": 1 })
          $(".hede").css({ "opacity": 0 })
        }
      }
    },
    components: {
      Header,
      Tabbar,
    },
    beforeRouteEnter(to, from, next) {
      next((vm) => {
        vm.userId = localStorage.getItem("userId"); //用户id
        if (localStorage.getItem("userid_ben")) {
          vm.userId = localStorage.getItem("userid_ben");
          localStorage.setItem("userId", vm.userId);
        } else {
          localStorage.setItem("userid_ben", vm.userId);
        }
           vm.isactive();
            vm.UpdateSystem(); //检查当前app版本是否需要更新
            vm.ismobile(1);
            vm.isLogin();
            $(".content").animate(
              { scrollTop: localStorage.getItem("index_scroll") },
              0
            );
            vm.tel = localStorage.getItem("tel"); //用户id
            vm.cardWhether = localStorage.getItem("cardWhether"); //用户id
            vm.checkRwjb()
            vm.indexrank();
            vm.img_path = vm.$global_msg.Url.hosts;
            vm.img_path1 = vm.$global_msg.Url.jd_url;
            if (sessionStorage.getItem("showed") == 1) {
              vm.search_ss = "";
              vm.search_inpt_bg_is = false;
              vm.list = [];
              vm.onRefresh();
            }
      });
    },
    created() {
      sessionStorage.removeItem("oppo")
    },
  };
</script>

<style scoped>
  .van-tabbar {
    padding: 0.4rem 0;
  }

  #yy {
    height: 1.6667rem;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    border-top: 1px solid #cccccc;
  }

  #yy .van-tabbar--fixed {
    position: fixed;
    bottom: 0;
    left: 0;

    /* background: #0c1d37; */
  }

  .van-tabbar--fixed {
    border-top: 1px solid #cccccc;
    border: none;
    padding-top: 0.8rem;
  }

  .van-tabbar-item {
    font-size: 0.44rem;
    line-height: 0.6rem;
  }

  .van-tabbar-item__icon img {
    display: block;
    height: 0.5333rem;
  }

  [class*="van-hairline"]::after {
    border: none;
  }

  .fb {
    font-size: 0.481481rem;
    text-align: center;
    margin-top: 0.37037rem;
  }

  .savegg {
    font-size: 0.407407rem;
    text-align: center;
    margin-top: 0.185185rem;
  }

  .makesure {
    color: #007aff;
    font-size: 0.444444rem;
    width: 100%;
    text-align: center;
    margin-top: 0.37037rem;
  }

  .line {
    border-top: 1px solid#E5E5E5;
    margin-top: 0.740741rem;
  }

  /* .van-grid {
    position: fixed;
    bottom: 0;
    margin-bottom: 1.9rem;
  } */

  /* .van-grid-item:nth-child(3) img {
    display: none;
  } */

  /* .van-grid-item:nth-child(4) img {
    display: none;
  } */

  /*.van-grid-item:nth-child(3) .redx {
    display: none;
  }*/

  .van-grid-item:nth-child(4) .redx {
    display: none;
  }

  .van-grid-item__content {
    background: none;
  }

  .LGgin {
    margin: 0 auto;
    width: 2rem;
    height: 2rem;
    margin-top: 1.1111rem;
  }

  .save {
    text-align: center;
    font-size: 0.444444rem;
    color: #ffffff;
    margin-top: 0.185185rem;
  }

  .content_up {
    position: fixed;
    bottom: 0;
    margin-bottom: 2rem;
  }

  .box_box2 {
    display: flex;
    flex-wrap: wrap;
    margin-left: 0.6rem;
  }

  .box_box {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-left: 0.6rem;
  }

  .box_big {
    width: 25%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
  }

  .content {
    width: 100%;
    height: 100vh;
    position: fixed;
    overflow-y: auto;
    z-index: 1;
  }

  .van-grid-item__content {
    background-color: none;
  }

  .icon {
    width: 1.8rem;
    height: 1.8rem;
  }

  .tit {
    color: #ffffff;
    font-size: 0.36rem;
    margin-top: -0.37037rem;
    margin-left: 0.222222rem;
  }

  .tit.active {
    margin-left: -0.2rem;
  }

  .title {
    font-size: 0.9333rem;
    color: #ffffff;
  }

  .platform {
    color: #ffffff;
    font-size: 0.5rem;
    margin-top: -1.6rem;
  }

  .service {
    margin: 0.37037037037037035rem 0 0 0.37037037037037035rem;
    font-size: 0.42592592592592593rem;
    color: #000;
    margin-bottom: 0.8rem;
  }

  .hours {
    width: 1rem;
    height: 1rem;
    /* filter: grayscale(100%); */
  }

  .grayscale {
    filter: grayscale(100%);
  }

  .van-grid-item__content {
    background: none;
    /* padding: 0; */
  }

  .box {
    margin-top: 0.8rem;
    display: inline-flex;
    align-items: center;
    overflow-y: hidden;
  }

  .box>div {
    width: 2.3519rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.0741rem;
  }

  .words {
    font-size: 0.36rem;
    line-height: 0.3888888888888889rem;
    height: 0.3888888888888889rem;
    color: #ffffff;
    margin-top: 0.1852rem;
  }

  .money_photo {
    height: 0.5867rem;
    width: 0.4933rem;
  }

  .Repair_photo {
    width: 0.6rem;
    height: 0.6267rem;
  }

  .van-tabbar--fixed {
    border-top: 1px solid black;
  }

  .box {
    margin-top: 0.2778rem;
    box-sizing: border-box;
  }

  .wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
  }

  .block {
    width: 120px;
    height: 120px;
    background-color: #fff;
  }

  .content_box {
    background: rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 10000000000000;
  }

  .content_box_son {
    width: 76%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 0.37037037037037035rem;
    /* padding: 0.46296296296296297rem 0.6481481481481481rem; */
    z-index: 100;
  }

  .intro {
    text-indent: 0.7777777777777778rem;
    line-height: 0.5185185185185185rem;
    font-size: 0.388889rem;
  }

  .explanation {
    font-size: 0.48148148148148145rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.37037037037037035rem;
  }

  .select {
    display: flex;
    font-size: 0.388889rem;
    color: #007aff;
    justify-content: space-around;
    margin-top: 0.32rem;
  }

  .btn {
    width: 92.5%;
    height: 0.9259259259259259rem;
    border-radius: 0.09259259259259259rem;
    background: #2b6cfe;
    color: white;
    text-align: center;
    line-height: 0.9259259259259259rem;
    margin: inherit;
    font-size: 0.425rem;
    font-size: 0.32rem;
    border-radius: 1.277778rem;
  }

  .tipstitle {
    font-size: 0.48148148148148145rem;
    font-weight: 600;
    text-align: left;
    margin-bottom: 0.37037037037037035rem;
    border-bottom-color: #efeff0;
    border-bottom-style: solid;
  }

  .redx {
    width: 0.2704rem;
    height: 0.2704rem;
    background: #ff0000;
    border-radius: 50%;
    position: absolute;
    /* top: 0.5407rem; */
    top: 0.1rem;
    right: 0.7407rem;
    z-index: 100;
  }

  .top {
    width: 100%;
    height: 6.2267rem;
  }

  .content_box {
    background: rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 90;
    display: flex;
  }

  .content_box_song {
    width: 90%;
    /* height: 4.8267rem; */
    margin: auto;
    z-index: 100000000;
    align-items: center;
    justify-content: center;
    /* margin-bottom:100%; */
    background: white;
    border-radius: 0.37037rem;
    overflow: hidden;
    padding-bottom: 0.37037rem;
  }

  /* 头部样式 */
  .header_top {

    padding-top: 0.9259rem;
    background-image: url("../assets/images/img/banner.png");
    /* height: 5.8704rem; */
    background-size: 100% 100%;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding-bottom: 0.1852rem;
    z-index: 100;
    height: 5.8889rem;
  }

  .hede {
    padding: 0 0.3148rem;

  }

  .zhanswei {
    height: 0.9259rem;
    z-index: 1005;
    position: fixed;
    top: 0;
    width: 100%;
    background: #007aff;
    opacity: 0;

  }

  .header_top_search {
    display: flex;
    align-items: center;
  }

  .search {
    background: #fff;
    border-radius: 0.9259rem;
    flex: 1;
    height: 0.9259rem;
    position: relative;
    display: flex;
    align-items: center;
  }

  .search_inpt {
    height: 0.9259rem;
    padding: 0 0.3704rem;
    border-radius: 0.9259rem;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.3889rem;
    z-index: 100;
    position: absolute;
    background: transparent;
    padding-right: 0.7407rem;
  }

  .search_inpt_bg {
    background: #fff;
  }

  .img_xj {
    width: 0.5926rem;
    height: 0.463rem;
    margin-left: 0.3148rem;
  }

  .search_bg {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    font-size: 0.3889rem;
    color: #8c8c8c;
    z-index: 1;
    padding: 0 0.3704rem;
    box-sizing: border-box;
  }

  .img_ss {
    height: 0.3611rem;
    width: 0.3426rem;
  }

  .img_xx {
    height: 0.3611rem;
    width: 0.3426rem;
    position: absolute;
    right: 0.3704rem;
    z-index: 101;
  }

  .btn_ss {
    margin-left: 0.3148rem;
    color: #fff;
    font-size: 0.3889rem;
  }

  /* 头部完 */
  .hr {
    height: 0.1852rem;
    background: #f1f1f1;
    width: 100%;
  }

  /* 下面的列表 */
  .main-index {
    padding-top: 5.8704rem;
    padding-bottom: 1.6667rem;
  }

  .main_item {
    /* height: 2.4074rem; */
    border-bottom: 1px solid #ddd;
    display: flex;
    padding: 0.2778rem;
    justify-content: space-between;
  }

  .ffdd {
    height: 2.4074rem;
    width: 3.0185rem;
  }

  .img_item {
    object-fit: cover;
    height: 100%;
    width: 100%;
    display: block;
  }

  .item_left {
    /* height: 100%; */
    margin-right: 0.1852rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.0926rem 0;
    box-sizing: border-box;
    flex: 1;
    padding-bottom: 0;
  }

  .item_left_top {
    font-size: 0.425925rem;
    line-height: 0.5556rem;
    letter-spacing: 0.037rem;
    /* display: flex;
    flex-wrap: wrap;
    font-size: 0.3889rem; */
  }

  .item_left_top_item {
    display: flex;
    /* padding-left: 0.6667rem; */
    position: relative;
  }

  .item_left_bottom {
    display: flex;
    /* padding-left: 0.6667rem; */
    font-size: 0.2778rem;
    color: #7f8699;
    justify-content: space-between;
  }

  .img_news {
    width: 0.5556rem;
    height: 0.2778rem;
    display: inline-block;
  }

  .van-swipe-item {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .miaoshu {
    width: 100%;
    /* padding-left: 0.6667rem; */
    font-size: 0.3333rem;
    color: #7f8699;
    box-sizing: border-box;
    display: none;
  }

  .mar-top {
    padding-top: 2.037rem;
  }

  .mar-bot {
    padding-bottom: 5.5rem;
  }

  .img_list {
    width: 0.4815rem !important;
    height: 0.4815rem;
    margin-right: 0.1852rem;
    position: absolute;
    left: 0;
    display: none;
  }

  .img_r {
    width: 0.3333rem;
    height: 0.3333rem;
    display: none;
  }

  .ren {
    display: flex;
    align-items: center;
  }

  .boxs {
    /* overflow: hidden; */
    max-height: 3.8519rem;
  }

  .boxs_active {
    overflow-x: auto;
  }
</style>
